UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GDN6k0wtGXhVfOPZE/WRRAv+37BsY1Yrj4TK28qP1+Q=' 
WHERE 
  key_id = 'be0c3e50072d6698dbc5b864386de40026d0a7e1385e3995d9f50e14743a9b68' 
  AND (
    token = 'GDN6k0wtGXhVfOPZE/WRRAv+37BsY1Yrj4TK28qP1+Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033