UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OH+TircJbynKTpkYgJept8JukjTtcKHBqcUnj0rT4KY=' 
WHERE 
  key_id = '3b8079e0d759af2eded6a2f58d7f3c1936fd0ac196a7e6901abbc63a82c75ffe' 
  AND (
    token = 'OH+TircJbynKTpkYgJept8JukjTtcKHBqcUnj0rT4KY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031