UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oeAWnBhwN/F0QGP+X+28L1CMPtvHJ7YSbQiYTD7BQbA=' 
WHERE 
  key_id = 'ff908dcdea10d6f831fc5d593d12e65415e1c0d416d097c200ef6497484476d3' 
  AND (
    token = 'oeAWnBhwN/F0QGP+X+28L1CMPtvHJ7YSbQiYTD7BQbA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029