UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RtBDS1KdAcf+zekjXCmuWuFHwNHbVpl5QYzchyS/OpA=' 
WHERE 
  key_id = '398ecc6ef0c0d22729c415ab5db75ccfa5119c7ba5fd6befc0b7d70143daa86d' 
  AND (
    token = 'RtBDS1KdAcf+zekjXCmuWuFHwNHbVpl5QYzchyS/OpA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039