UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8FR83dnu46svY2xs4XCpmGkAJBrc/84gc7l26bGi+Og=' 
WHERE 
  key_id = '73e76988efce8396653ce50a1ca5d6af4cbd495419b5d3b86d1013309029c146' 
  AND (
    token = '8FR83dnu46svY2xs4XCpmGkAJBrc/84gc7l26bGi+Og=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037