UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+L03GaP9D3c2A045DhCgjdyWw+bEJNB6XHwYnvi/UZQ=' 
WHERE 
  key_id = '9052013d307d95670e2d956729db79038e882561f4b599b827f0b2232da46198' 
  AND (
    token = '+L03GaP9D3c2A045DhCgjdyWw+bEJNB6XHwYnvi/UZQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039