UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EXL17etwbecRRjZipla21DJOJBxcPDGMBsz0/hG12tw=' 
WHERE 
  key_id = 'f4ed91a4c2cc2324e012cba75f54c6c3f1d6fbf2f6c11cf6a7c183b230e73151' 
  AND (
    token = 'EXL17etwbecRRjZipla21DJOJBxcPDGMBsz0/hG12tw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030