UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bk+ri7M/ZCvvraRbu1XNeOjn1P7M/k3mAibjRVUaH/I=' 
WHERE 
  key_id = '4bfe9f1b8e7c2994297ed2e1de726008550adf2f0985e3b80141e3a1cb137198' 
  AND (
    token = 'bk+ri7M/ZCvvraRbu1XNeOjn1P7M/k3mAibjRVUaH/I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030