UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't30p5C0rNJ6OJiKXIGCCG8mnjXGl+QZP7C/6F6IRvQ4=' 
WHERE 
  key_id = '6f44db767b943f50365b0313fe2673af76edf561893a88a4a7958f163f02edfd' 
  AND (
    token = 't30p5C0rNJ6OJiKXIGCCG8mnjXGl+QZP7C/6F6IRvQ4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044