UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mYlg1iCbOS/o3Zl7zu6zgHfDow0mnmEcpxskL8N/A4w=' 
WHERE 
  key_id = '2d16bb9e41f348dc044d7e1b4563157b8d9ad71741eccadd2ca6c801f27e0814' 
  AND (
    token = 'mYlg1iCbOS/o3Zl7zu6zgHfDow0mnmEcpxskL8N/A4w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015