UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MbK+8xsrS0hApK5tEXZ9BiQ0mzN39UEwiEMqkKG8l+Q=' 
WHERE 
  key_id = '68b611995bf1a99840c225984fcac44e671e1a85fb7a6a36a885b6eff836ccd6' 
  AND (
    token = 'MbK+8xsrS0hApK5tEXZ9BiQ0mzN39UEwiEMqkKG8l+Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024