UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DQKbU3f4shutf01cnJEnbwoqp6I+9plwlxmL6M2LQCE=' 
WHERE 
  key_id = 'cb34e982727fee1419e1dd033b0d2ef0c2e90062e892d1782c13da91dc07a8c5' 
  AND (
    token = 'DQKbU3f4shutf01cnJEnbwoqp6I+9plwlxmL6M2LQCE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048