UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iKavUBOfwTwyWWCZpLri+9S4J5Mbi8Nrbcq9wa6x/oA=' 
WHERE 
  key_id = '2bfc2367b2219b896d5d2a69b298cfb96dcae685e29e3cf3df44c4444b9d4db5' 
  AND (
    token = 'iKavUBOfwTwyWWCZpLri+9S4J5Mbi8Nrbcq9wa6x/oA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020