UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kNBkndRpALhLYTs/LbB+KR6Nl4ez1EB4E7ALWdiZXm0=' 
WHERE 
  key_id = '62d94aa8bae1d5b82f71f15b2b2726e66c05d50581523843d7e03a2984273661' 
  AND (
    token = 'kNBkndRpALhLYTs/LbB+KR6Nl4ez1EB4E7ALWdiZXm0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030