UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EA2hCkx7IdtohRbzTSnqwi1tscnj2aKDvBjXwp0Q/Nw=' 
WHERE 
  key_id = '98d7bff1e8ca58537309fc6c4c5fbb4de1adaeb5785cdecfa0ba164c415d0201' 
  AND (
    token = 'EA2hCkx7IdtohRbzTSnqwi1tscnj2aKDvBjXwp0Q/Nw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026